using System;
using TestCases.CompareAssert.Core.Interfaces;
using TestCases.Utils;

namespace TestCases.CompareAssert.Core.Builders
{
    public class ObjectExpression : IObjectExpression
    {
        private readonly string _path;
        private readonly IResultBuilder _resultBuilder;

        public ObjectExpression(IResultBuilder resultBuilder, string path)
        {
            _resultBuilder = resultBuilder;
            _path = path;
        }

        public IResultBuilder IsNot<T>()
        {
            return IsNot(typeof(T));
        }

        public IResultBuilder IsNot(Type type)
        {
            return IsNot(type.ToString());
        }

        public IResultBuilder IsNot(string type)
        {
            return _resultBuilder.Message("{Path} is not <{Type}>.".FormatWith(new {Path = _path, @Type = type}));
        }
    }
}